package com.bi.dataDmTrans.controller;

import com.bi.dataDmTrans.service.DataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/data")
public class DataController {

    @Autowired
    private DataService dataService;

    @GetMapping("/fetchAndSave")
    public String fetchDataAndSave() {
        dataService.fetchDataAndSave();
        return "Data fetch and save process started.";
    }

    @GetMapping("/fetchAndSave1")
    public String fetchDataAndSave1() {
        dataService.fetchDataAndSave1();
        return "Data fetch and save process started.";
    }
}
